import java.util.Scanner;

public class test1 {

    public static String longestCommonPrefix(String[] strs) {
        if(strs.length == 0){
            return "";
        }
        String s = strs[0];
        for (String str : strs) {
            while(!str.startsWith(s)){
                if(s.length() == 0){
                    return "";
                }
                //减少一位比较
                s = s.substring(0, s.length() - 1);
            }
        }
        return s;
    }


    public class 一维差分 {
        public  void main(String[] args){
            //初始化数据
            Scanner in = new Scanner(System.in);
            int n = in.nextInt(), times = in.nextInt();
            int[] a = new int[n+2], b = new int[n+2];

            //导入原数组
            for (int i = 1; i<=n; i++) {a[i] = in.nextInt();}
            //计算差分数组，核心思想为前缀和逆运算，也就是b[i] = a[i]-a[i-1]
            for (int i = 1; i<=n; i++) {insert(b, i, i, a[i]);}

            //对差分数组某区域整体加减，核心思想为，l-r下标范围整体+c，那么就将(l)+c，(r+1)-c
            //这样在计算前缀和的时候达到自动进行全部加减，只影响区域内的数据
            while (times-- > 0) {
                int l = in.nextInt(), r = in.nextInt(), c = in.nextInt();
                insert(b, l, r, c);
            }

            //将b数组转为b的前缀和数组
            for (int i = 1; i<=n; i++) {b[i]+=b[i-1];}

            //输出结果
            for (int i = 1; i<=n; i++) {
                System.out.print(b[i]+" ");
                if (i==n) System.out.println();
            }
        }
        //insert，差分的模板运算
        //1.使用在差分数组初始化时
        //2.使用在进行对差分数组某区域整体加减时
        public  void insert(int[] b, int l, int r, int c){
            b[l] += c;
            b[r+1] -= c;
        }
    }

    private static long handle(String statement) {
        if (statement.isEmpty()) return 0;
        int type = getType(statement);//方便判断类型
        if (type == 1 || type == 2) {//数组
            int cnt = 0;//数组长度之和
            String[] res = statement.split("[=,]");//按照"="和","切割,这样奇数项就是"new type[len]"的形式
            for (int j = 1; j < res.length; j += 2) {
                //截取每个数组长度c
                int idx1 = res[j].lastIndexOf("["), idx2 = res[j].lastIndexOf("]");
                int c = Integer.parseInt(res[j].substring(idx1 + 1, idx2));
                cnt += c;
            }
            return type == 1 ? cnt * 4L : cnt * 8L;
        }
        if (type == 5) {
            String[] res = statement.split("\"");
            long len = 0;//统计长度
            for (int j = 1; j < res.length; j += 2) {
                len += res[j].length();
            }
            return len;
        }
        int count = 0;//赋值语句个数
        for (char ch : statement.toCharArray()) {
            if (ch == '=') count++;
        }
        return type == 3 ? count * 4L : count * 8L;
    }


}
